/**
 *  @file SDLRectangleRepresentation.h
 *
 *  @date 26-nov-2009
 *  @author Ives van der Flaas
 */

#ifndef SDLRECTANGLEREPRESENTATION_H_
#define SDLRECTANGLEREPRESENTATION_H_

#include <tr1/memory>
#include "SDLShapeRepresentation.h"
#include "vector2.h"
#include "SDLColor.h"
namespace si_sdl
{
/**
 * Represents a colored rectangle. No alpha!
 */
class SDLRectangleRepresentation: public si_sdl::SDLShapeRepresentation
{
public:
	/**
	 * Ctor
	 * @param virtualPos Where the rect will be drawn
	 * @param virtualSize How big the rect will be
	 * @param color Which color the rect will be
	 * @return
	 */
	SDLRectangleRepresentation(si::Vector2 virtualPos, si::Vector2 virtualSize, Color color);

	/**
	 * Does the same as ctor+draw, but it's faster! THIS DRAWS ABSOLUTE! So use absolute coordinates!!
	 * @param absPos absolute position
	 * @param absSize absolute size
	 * @param color	the color
	 */
	static void drawRect(
		si::Vector2 absPos,
		si::Vector2 absSize,
		Color color);

	virtual ~SDLRectangleRepresentation();

private:

	static void drawOnSurface(si::Vector2 virtualPos,
		si::Vector2 VirtualSize,
		Color color,
		std::tr1::shared_ptr<SDL_Surface> surfToDrawOn);
	si::Vector2 fPos;
	si::Vector2 fSize;
	Color fColor;

};

}

#endif /* SDLRECTANGLEREPRESENTATION_H_ */
